package com.stsdai.portal.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("page")
public class PageController {

	// http://www.stsdai.com/page/login.html
	// http://www.stsdai.com/page/register.html
	/**
	 * 通用页面跳转
	 * 
	 * @param pageName
	 * @return
	 */
	@RequestMapping("{pageName}")
	public String page(@PathVariable String pageName, 
			@RequestParam(value="redirectURL", defaultValue="") String redirectURL,
			Model model){
		
		//把被拦截的URL重定向过来传递给页面，让页面登录完成后再请求这个被拦截的URL
		model.addAttribute("redirectURL", redirectURL);
		return pageName;
	}
	
	

}
